<HTML><HEAD><TITLE>char_int(?Char, ?Integer)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Obsolete</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>char_int(?Char, ?Integer)</H1>
Succeeds if Integer is the ASCII code of the one-character string Char.


<DL>
<DT><EM>Char</EM></DT>
<DD>One-character string or variable.
</DD>
<DT><EM>Integer</EM></DT>
<DD>Integer (in the range 0 to 255) or variable.
</DD>
</DL>
<H3>This built-in predicate is obsolete!</H3>
<H2>Description</H2>
   If Char is instantiated, converts it to its corresponding ASCII code.

<P>
   If Integer is instantiated, converts it to its corresponding
   one-character string.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>char_int(+, -) is det
<LI>char_int(-, +) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Char is instantiated, but not to a 1-character string.
<DT><EM>(5) type error </EM>
<DD>Integer is instantiated, but not to an integer.
<DT><EM>(6) out of range </EM>
<DD>Integer is instantiated to an integer outside the range 0 to 255.
<DT><EM>(4) instantiation fault </EM>
<DD>Neither Char nor Integer are instantiated (non-coroutine    mode only).
</DL>
<H2>Examples</H2>
<PRE>
   Success:
   char_int("b",98).
   char_int(C,99).     (gives C="c").
   char_int("a",I).    (gives I=97).
   Fail:
   char_int("a",98).
   Error:
   char_int(C,I).       (Error 4).
   char_int("ab",I).    (Error 5).
   char_int('a',I).     (Error 5).
   char_int(C,'30').    (Error 5).
   char_int(C,128).     (Error 6).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/termmanip/char_code-2.html">char_code / 2</A>, <A HREF="../../kernel/iochar/get_char-1.html">get_char / 1</A>, <A HREF="../../kernel/iochar/get_char-2.html">get_char / 2</A>, <A HREF="../../kernel/iochar/put_char-1.html">put_char / 1</A>, <A HREF="../../kernel/iochar/put_char-2.html">put_char / 2</A>, <A HREF="../../kernel/stratom/string_list-2.html">string_list / 2</A>, <A HREF="../../kernel/stratom/string_list-3.html">string_list / 3</A>
</BODY></HTML>
